﻿Public Class FrmBloquearEscritorio

    Private Sub tbContrasena_KeyPress(sender As System.Object, e As System.Windows.Forms.KeyPressEventArgs) Handles tbContrasena.KeyPress
        If e.KeyChar = ChrW(Keys.Enter) Then
            Dim usuario As GBDZafiro.Usuario

            If Not tbContrasena.TextLength < 1 Then
                usuario = crearUsuario()
                usuario.clave = tbContrasena.Text
                If GBDZafiro.Usuario.ConsxCodUsuarioClave(usuario) Then
                    tbContrasena.Clear()
                    Me.Close()
                Else
                    msnBox.msnError("Error clave incorrecta")
                    tbContrasena.Clear()
                End If
            End If

        End If

    End Sub

    Private Function crearUsuario() As GBDZafiro.Usuario
        Dim usuario As New GBDZafiro.Usuario
        usuario.codUsuario = Login.usuario.codUsuario
        Return usuario
    End Function

    Private Sub tbContrasena_TextChanged(sender As System.Object, e As System.EventArgs) Handles tbContrasena.TextChanged

    End Sub

    Private Sub FrmBloquearEscritorio_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class